import React ,{ lazy } from "react"
import { Navigate,Outlet } from "react-router-dom"

 
const Discover = lazy(_ => import('../pages/discover'))
const Recommend = lazy(_ => import('../pages/discover/c-cpns/recommend'))
const Toplist = lazy(_ => import('../pages/discover/c-cpns/toplist'))
const Playlist = lazy(_ => import('../pages/discover/c-cpns/playlist'))
const Artist = lazy(_ => import('../pages/discover/c-cpns/artist'))
const Album = lazy(_ => import('../pages/discover/c-cpns/album'))
const DjRadio = lazy(_ => import('../pages/discover/c-cpns/djradio'))
const Song = lazy(_ => import('../pages/discover/c-cpns/song'))
const PlaylistDetail = lazy(_ => import('../pages/discover/c-cpns/playlist/c-cpns/playlist-detail'))
const ArtistDetail = lazy(_ => import('../pages/discover/c-cpns/artist/c-cpns/artist-detail'))
const DjradioDetail = lazy(_ => import('../pages/discover/c-cpns/djradio/c-cpns/djradio-detail'))
const AlbumDetail = lazy(_ => import('../pages/discover/c-cpns/album/c-cpns/album-detail'))
const Friend = lazy(_ => import('../pages/friend'))
const My = lazy(_ => import('../pages/my'))
const Search = lazy(_ => import('../pages/search'))
const routes = [
  {
    path:'/',
    exact:true,
    element: <Navigate to="/discover/recommend"/>
  },
  {
    path:'discover',
    element: (
      <>
        <Discover/>
        <Outlet />
        </>
    ),
    children:[
      {
        path:'recommend',
        element:<Recommend/>
      },
      {
        path:'playlist',
        element:<Playlist/>
      },
      {
        path:'toplist',
        element:<Toplist/>
      },
      {
        path:'artist',
        element:<Artist/>
      },
      {
        path:'album',
        element:<Album/>
      },
      {
        path: 'djradio',
        element:<DjRadio/>
      },
      {
        path: 'song/:id',
        element:<Song/>
      },
      {
        path: 'playlistDetail/:id',
        element:<PlaylistDetail/>
      },
      {
        path: 'artistDetail/:id',
        element:<ArtistDetail/>
      },
      {
        path: 'djradioDetail/:id',
        element:<DjradioDetail/>
      },
      {
        path: 'albumDetail/:id',
        element:<AlbumDetail/>
      }
    ]
    
  },
  {
    path:'/friend',
    element:<Friend/>
  },
  {
    path:'/my',
    element:<My/>
  },
  {
    path: '/search/:keywords/:type',
    element:<Search/>
  }
  
]
export default routes